﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using PSE.Framework.Configuration;

namespace Sinacor.UI.Application.Settings.SmartClient
{
    /// <summary>
    /// Seção para configuração dos temas da aplicação
    /// </summary>
    public class ThemesConfigurationSection : ConfigurationSection
    {
        public ThemesConfigurationSection()
        {
        }

        /// <summary>
        /// Tema default do sistema
        /// </summary>
        [ConfigurationProperty("defaultTheme", IsRequired=true)]
        public string DefaultTheme
        {
            get
            {
                return (string)this["defaultTheme"];
            }
            set
            {
                this["defaultTheme"] = value;
            }
        }

        /// <summary>
        /// Temas instalados no sistema
        /// </summary>
        [ConfigurationProperty("installedThemes", IsRequired = true, IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(ClassToInstanceInformation), AddItemName = "theme")]
        public ConfigurationCollection<ClassToInstanceInformation> InstalledThemes
        {
            get
            {
                return (ConfigurationCollection<ClassToInstanceInformation>)this["installedThemes"];
            }
        }

		/// <summary>
		/// Temas iniciais no sistema
		/// </summary>
		[ConfigurationProperty("initialThemes", IsRequired = true, IsDefaultCollection = true)]
		[ConfigurationCollection(typeof(ClassToInstanceInformation), AddItemName = "initial")]
        public ConfigurationCollection<ClassToInstanceInformation> InitialThemes
		{
			get
			{
                return (ConfigurationCollection<ClassToInstanceInformation>)this["initialThemes"];
			}
		}
    }
}
